import request from '@/utils/axios'

export function login(data) {
  return request('/login', {
    method: 'post',
    data: {
      username: data.username,
      password: data.password,
    },
  })
}

export function getImg() {
  return request('/imglist')
}

export function getGoodsList(category_id) {
  return request('/goodslist', {
    method: 'GET',
    params: {
      category_id: category_id,
    },
  })
}
export function saveAddress(address) {
  return request('/address/save', {
    method: 'post',
    data: {
      name: address.name,
      tel: address.tel,
      area: address.area,
      detail: address.detail,
    },
  })
}

export function getAddress() {
  return request('/address')
}
